// https://www.cnblogs.com/jsersudo/p/10154726.html


/**
 * Created by Jxy on 2018/12/21 7:43
 * 三种构造函数的使用
 * Groovy方法、参数
 */
 // https://www.cnblogs.com/varlxj/p/5181788.html 【Groovy中那些神奇注解之ToString】
 @groovy.transform.ToString   
class PersonConstructor {
    String name
    Integer age

    PersonConstructor(name, age) {
        this.name = name
        this.age = age
    }
}

def person1 = new PersonConstructor('Marie', 1)
def person2 = ['Marie', 2] as PersonConstructor
PersonConstructor person3 = ['Marie', 3]

println person3